import { AxiosRequestConfig, AxiosResponse } from "axios";

export interface RequestInterceptors {
  // 请求拦截
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig;
  // 请求异常拦截
  requestInterceptorCatch?: (err: any) => any;

  // 响应拦截
  responseInterceptor?: (config: AxiosResponse) => AxiosResponse;
  // 响应异常拦截
  responseInterceptorCatch?: (err: any) => any;
}

/***
 * 初始化实例配置
 */
export interface InitRequestConfig extends AxiosRequestConfig {
  // 拦截器对象
  interceptors?: RequestInterceptors;
}
